﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Pay.DTO {
    /// <summary>
    /// 物流快递信息
    /// </summary>
    [Serializable]
    public class logistic_result {
        public logistic_result() {
            traces = new List<trace_model>();
        }
        /// <summary>
        /// 成功与否
        /// </summary>
        public bool success { get; set; }
        /// <summary>
        /// 物流状态：2-在途中,3-签收,4-问题件
        /// </summary>
        public int state { get; set; }
        /// <summary>
        /// 失败原因
        /// </summary>
        public string reason { get; set; }
        public List<trace_model> traces { get; set; }
    }
    /// <summary>
    /// 物流快递跟踪信息
    /// </summary>
    [Serializable]
    public class trace_model {
        /// <summary>
        /// 时间
        /// </summary>
        public string accept_time { get; set; }
        /// <summary>
        /// 描述
        /// </summary>
        public string accept_station { get; set; }
        /// <summary>
        /// 备注
        /// </summary>     
        public string remark { get; set; }
    }
    /// <summary>
    /// 物流响应结果
    /// </summary>
    public class logistic_results {
        /// <summary>
        /// 用户ID
        /// </summary>
        public string EBusinessID { get; set; }
        /// <summary>
        /// 快递公司编码
        /// </summary>
        public string ShipperCode { get; set; }
        /// <summary>
        /// 成功与否
        /// </summary>
        public bool Success { get; set; }
        /// <summary>
        /// 物流运单号
        /// </summary>
        public string LogisticCode { get; set; }
        /// <summary>
        /// 物流状态：2-在途中,3-签收,4-问题件
        /// </summary>
        public string State { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public List<Trace> Traces { get; set; }
    }

    public class logistic_results_ex {
        public string ebusiness_id { get; set; }
        public string shipper_code { get; set; }
        public bool success { get; set; }
        public string logistic_code { get; set; }
        public string state { get; set; }
        public List<trace> traces { get; set; }
    }

    public class trace {
        public string board_no { get; set; }
        public string board_name { get; set; }
        public string accept_time { get; set; }
        public string accept_station { get; set; }
        public string manage_name { get; set; }
    }

    public class Trace {
        public string AcceptTime { get; set; }
        public string AcceptStation { get; set; }
    }
    public class order_logistic_results {
        /// <summary>
        /// 订单id
        /// </summary>
        public long order_id { get; set; }
        /// <summary>
        /// 物流公司
        /// </summary>
        public string express_company_name { get; set; }
        /// <summary>
        /// 物流单号
        /// </summary>
        public string ship_order_number { get; set; }
        /// <summary>
        /// 物流结果
        /// </summary>
        public logistic_results logistic_results { get; set; }
    }
    /// <summary>
    /// 快递100 物流接口
    /// </summary>
    public class k100_logistic_results {
        /// <summary>
        /// 消息体，请忽略
        /// </summary>
        public string message { get; set; }
        /// <summary>
        /// 快递单当前签收状态，包括0在途中、1已揽收、2疑难、3已签收、4退签、5同城派送中、6退回、7转单等7个状态，其中4-7需要另外开通才有效
        /// </summary>
        public int state { get; set; }
        /// <summary>
        /// 通讯状态，请忽略
        /// </summary>
        public int status { get; set; }
        /// <summary>
        /// 快递单明细状态标记，暂未实现，请忽略
        /// </summary>
        public string condition { get; set; }
        /// <summary>
        /// 是否签收标记，请忽略，明细状态请参考state字段
        /// </summary>
        public bool ischeck { get; set; }
        /// <summary>
        /// 快递公司编码,一律用小写字母
        /// </summary>
        public string com { get; set; }
        /// <summary>
        /// 单号
        /// </summary>
        public string nu { get; set; }
        /// <summary>
        /// 最新查询结果，数组，包含多项，全量，倒序（即时间最新的在最前），每项都是对象，对象包含字段请展开
        /// </summary>
        public List<k100_trace> data {get;set;}
    }
    /// <summary>
    /// 快递100 物流轨迹
    /// </summary>
    public class k100_trace {
        /// <summary>
        /// 内容
        /// </summary>
        public string context { get; set; }
        /// <summary>
        /// 时间，原始格式
        /// </summary>
        public DateTime time { get; set; }
        /// <summary>
        /// 格式化后时间
        /// </summary>
        public DateTime ftime { get; set; }
    }
    /// <summary>
    /// k100 物流信息
    /// </summary>
    public class order_k100_logistic_results {
        /// <summary>
        /// 订单id
        /// </summary>
        public long order_id { get; set; }
        /// <summary>
        /// 物流公司
        /// </summary>
        public string express_company_name { get; set; }
        /// <summary>
        /// 物流单号
        /// </summary>
        public string ship_order_number { get; set; }
        /// <summary>
        /// 物流结果
        /// </summary>
        public k100_logistic_results logistic_results { get; set; }
    }

}
